package com.redbox.RedboxManagment.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.redbox.RedboxManagment.dao.ICard;
import com.redbox.RedboxManagment.ejb.Card;

@Service
public class CardServiceImp implements ICardService {

	@Autowired(required=true)
	private ICard cardDao;
	
	@Override
	@Transactional 
	public Card retrieveCard(int pId) {
		Card result = cardDao.findById(pId);
		return result;
	}

	@Override
	@Transactional
	public Card createCard(Card pCard) {
		Card result = cardDao.persistOnMerge(pCard);
		return result;
	}
}
